project(any)
cmake_minimum_required(VERSION 2.8)
enable_testing()

message("C++ compiler id: ${CMAKE_CXX_COMPILER_ID}")
message("C++ compiler version is: ${CMAKE_CXX_COMPILER_VERSION}")

set(CMAKE_CXX_STANDARD 17)
add_compile_options(-fno-rtti -DANY_IMPL_NO_RTTI -DHST_ANY_WITH_NO_RTTI)
add_compile_options(-I${CMAKE_CURRENT_SOURCE_DIR}/hst_any_depends)

add_library(test_lib SHARED test_shared_lib.hpp test_shared_lib.cpp)

add_executable(test_any test_any.cpp linux_adapter.cpp)
target_link_libraries(test_any PRIVATE test_lib)
target_compile_options(test_any PRIVATE
  $<$<CXX_COMPILER_ID:MSVC>:/W4 /WX>
  $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wall -Wextra>
)

add_test(test_any test_any)


add_library(verify_lib SHARED verify_shared_lib.hpp verify_shared_lib.cpp)

add_executable(verify_any verify_any.cpp linux_adapter.cpp)
target_link_libraries(verify_any PRIVATE verify_lib)

add_executable(verify_meta verify_meta.cpp verify_meta2.cpp)
